/*  Copyright 2019 Jimmy Hogoboom
 *
 *  This file is part of crumb.
 *
 *  crumb is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Affero General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  crumb is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with crumb.  If not, see <https://www.gnu.org/licenses/>.
 */

using System;
using System.Collections.Generic;
using crumb.Api.Core.Domain.Accounts;
using crumb.Api.Core.Domain.ValueObjects;
using NUnit.Framework;

namespace crumb.Api.Core.Domain.Users
{
    [TestFixture]
    public class UserTests
    {
        private readonly User _user;
        private static readonly Guid Id = Guid.Parse("a8bc7a5a-9ebb-43ae-aafa-8af433b55135");
        private const string UserName = "jimmy";
        private readonly Password Password = new Password("foo", "bar");
        private const string Email = "jimmy@crumb.com";
        private readonly IEnumerable<Account> Accounts = new List<Account>(){
            new Account(Id, "foo", "bar")
        };

        public UserTests()
        {
            _user = new User();
        }

        [Test]
        public void TestSetAndGetId()
        {
            _user.Id = Id;

            Assert.That(_user.Id,
                Is.EqualTo(Id));
        }

        [Test]
        public void TestSetAndGetName()
        {
            _user.UserName = UserName;

            Assert.That(_user.UserName,
                Is.EqualTo(UserName));
        }

        [Test]
        public void TestSetAndGetPassword()
        {
            _user.Password = Password;

            Assert.That(_user.Password,
                Is.EqualTo(Password));
        }

        [Test]
        public void TestSetAndGetEmail()
        {
            _user.Email = Email;

            Assert.That(_user.Email,
                Is.EqualTo(Email));
        }
    }
}